package cn.zhaoyuening.fandamin.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Buynow on 2017/7/2.
 * <h3>管理用户</h3>
 * 用户可以获得角色的分配
 */
@Entity
@Table(name = "t_adminUser")
public class AdminUser {
    @Id
    private String username;
    @Column(nullable = false)
    private String password;
    //用户创建日期
    @Column
    private Date createDate;
    //图标
    @Column
    private String icon;
    //是否可用
    @Column
    private Boolean available;
    @Column
    private String email;

    public AdminUser(String username, String password, Date createDate, String icon, Boolean available, String email) {
        this.username = username;
        this.password = password;
        this.createDate = createDate;
        this.icon = icon;
        this.available = available;
        this.email = email;
    }

    public AdminUser() {
    }

    public String getUsername() {
        return username;
    }

    public AdminUser setUsername(String username) {
        this.username = username;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public AdminUser setPassword(String password) {
        this.password = password;
        return this;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public AdminUser setCreateDate(Date createDate) {
        this.createDate = createDate;
        return this;
    }

    public String getIcon() {
        return icon;
    }

    public AdminUser setIcon(String icon) {
        this.icon = icon;
        return this;
    }

    public Boolean getAvailable() {
        return available;
    }

    public AdminUser setAvailable(Boolean available) {
        this.available = available;
        return this;
    }

    public String getEmail() {
        return email;
    }

    public AdminUser setEmail(String email) {
        this.email = email;
        return this;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj instanceof AdminUser)) {
            return false;
        }
        AdminUser adminUser = (AdminUser) obj;
        if (adminUser.getUsername().equals(this.getUsername())) {
            return true;
        }
        return false;
    }
}
